
interface customThemeType {
    id: string;
    name: string;
    langkey: string;
    color?: string | undefined;
    size?: string | number | undefined;
    fontSize?: string;
    isShow?: boolean;
    path?: string;
    outId?: string;
  }
  
  const platform = InbizConfig.platform
  export const defaultTheme: customThemeType[] = [
    {
      id: 'techblue',
      isShow: false,
      langkey: 'techblue',
      name: '科技蓝',
      color: '#1989fa',
    },
    {
      id: 'gray',
      isShow: false,
      langkey: 'gray',
      name: '高级灰',
      color: '#768599',
    },
    {
      id: 'deepskyblue',
      isShow: false,
      langkey: 'deepskyblue',
      name: '深空蓝',
      color: '#1B4285',
    },
    {
      id: 'purple',
      isShow: false,
      langkey: 'purple',
      name: '典雅紫',
      color: '#6001D2',
    },
    {
      id: 'deepblue',
      isShow: false,
      langkey: 'deepblue',
      name: '深蓝色',
      color: '#5299B7',
    },
  ];
  
  const builtInTheme: any = {
    techblue: {
      global: ['#1989fa'],
      topmenu: ['#fff', '#fff', '#fff', '#666', '#1989fa'],
      leftmenu: ['#fff', '#e7f3ff', '#f5f5f5', '#666', '#1989fa'],
    },
    gray: {
      global: ['#768599'],
      topmenu: ['#fff', '#fff', '#fff', '#666', '#768599'],
      leftmenu: ['#fff', '#eaedf0', '#f5f5f5', '#666', '#768599'],
    },
    deepskyblue: {
      global: ['#1B4285'],
      topmenu: ['#fff', '#fff', '#fff', '#666', '#1B4285'],
      leftmenu: ['#fff', '#e7ebf3', '#f5f5f5', '#666', '#1B4285'],
    },
    purple: {
      global: ['#6001D2'],
      topmenu: ['#fff', '#fff', '#fff', '#666', '#6001D2'],
      leftmenu: ['#fff', '#ebebfc', '#f5f5f5', '#666', '#6001D2'],
    },
    deepblue: {
      global: ['#5299B7'],
      topmenu: ['#fff', '#fff', '#fff', '#666', '#5299B7'],
      leftmenu: ['#fff', '#e8f0f4', '#f5f5f5', '#666', '#5299B7'],
    },
  };
  
  export const globalTheme = (langkey: string) => {
    const color = builtInTheme[langkey].global[0];
  
    return [
      {
        id: '--inbiz-color-primary',
        isShow: false,
        name: '主题色',
        langkey: 'primaryColor',
        color,
      },
      {
        id: '--inbiz-color-bg',
        isShow: false,
        name: '背景色',
        langkey: 'bgColor',
        color: '#fff',
      },
      {
        id: '--inbiz-color-link',
        isShow: false,
        name: '链接色',
        langkey: 'linkColor',
        color,
      },
      {
        id: '--inbiz-color-disabled',
        isShow: false,
        name: '失效色',
        langkey: 'disabledColor',
        color: 'rgba(0, 0, 0, 0.25)',
      },
      {
        id: '--inbiz-color-border-base',
        isShow: false,
        name: '边框色',
        langkey: 'borderColor',
        color: '#d9d9d9',
      },
      {
        id: '--inbiz-color-success',
        isShow: false,
        name: '成功色',
        langkey: 'successColor',
        color: '#52c41a',
      },
      {
        id: '--inbiz-color-warning',
        isShow: false,
        name: '警告色',
        langkey: 'warningColor',
        color: '#faad14',
      },
      {
        id: '--inbiz-color-danger',
        isShow: false,
        name: '错误色',
        langkey: 'errorColor',
        color: '#f5222d',
      },
      {
        id: '--inbiz-color-text',
        isShow: false,
        name: '主文本色',
        langkey: 'mainTextColor',
        color: 'rgba(0, 0, 0, 0.65)',
      },
      {
        id: '--inbiz-color-secondary-text',
        isShow: false,
        name: '次文本色',
        langkey: 'secondTextColor',
        color: 'rgba(0, 0, 0, 0.45)',
      },
      {
        id: '--inbiz-color-heading',
        isShow: false,
        name: '标题色',
        langkey: 'titleColor',
        color: 'rgba(0, 0, 0, 0.85)',
      },
      {
        id: '--inbiz-border-radius-base',
        isShow: false,
        name: '圆角',
        langkey: 'borderRadius',
        size: 2,
        fontSize: '2px',
      },
      {
        id: '--inbiz-font-size-base',
        isShow: false,
        name: '主字号',
        langkey: 'mainFontSize',
        size: platform == 'wap' ? 13 : 14,
        fontSize: platform == 'wap' ? '13px' : '14px',
      },
    ];
  };
  
  export const topmenuTheme = (langkey: string) => {
    const topmenu = builtInTheme[langkey]?.topmenu || [];
  
    return {
      one: [
        {
          id: '--inbiz-color-menu-top-bg',
          isShow: false,
          name: '背景',
          langkey: 'menuBg',
          color: topmenu[0],
        },
        {
          id: '--inbiz-color-menu-top-bg-selected',
          isShow: false,
          name: '选中背景',
          langkey: 'menuSelectBg',
          color: topmenu[1],
        },
        {
          id: '--inbiz-color-menu-top-bg-hover',
          isShow: false,
          name: 'hover背景',
          langkey: 'menuHoverBg',
          color: topmenu[2],
        },
        {
          id: '--inbiz-color-menu-top-default',
          isShow: false,
          name: '默认字色',
          langkey: 'menuFontColor',
          color: topmenu[3],
        },
        {
          id: '--inbiz-color-menu-top-selected',
          isShow: false,
          name: '选中字色',
          langkey: 'menuSelectFontColor',
          color: topmenu[4],
        },
        {
          id: '--inbiz-font-size-menu-top',
          isShow: false,
          name: '字号',
          langkey: 'menuFontSize',
          size: platform == 'wap' ? 13 : 14,
          fontSize: platform == 'wap' ? '13px' : '14px',
        },
      ],
      child: [
        {
          id: '--inbiz-color-menu-top-child-bg',
          isShow: false,
          name: '背景',
          langkey: 'menuBg',
          color: topmenu[0],
        },
        {
          id: '--inbiz-color-menu-top-bg-child-selected',
          isShow: false,
          name: '选中背景',
          langkey: 'menuSelectBg',
          color: topmenu[1],
        },
        {
          id: '--inbiz-color-menu-top-bg-child-hover',
          isShow: false,
          name: 'hover背景',
          langkey: 'menuHoverBg',
          color: topmenu[2],
        },
        {
          id: '--inbiz-color-menu-top-child-default',
          isShow: false,
          name: '默认字色',
          langkey: 'menuFontColor',
          color: topmenu[3],
        },
        {
          id: '--inbiz-color-menu-top-child-selected',
          isShow: false,
          name: '选中字色',
          langkey: 'menuSelectFontColor',
          color: topmenu[4],
        },
        {
          id: '--inbiz-font-size-menu-top-child',
          isShow: false,
          name: '字号',
          langkey: 'menuFontSize',
          size: platform == 'wap' ? 13 : 14,
          fontSize: platform == 'wap' ? '13px' : '14px',
        },
      ],
    };
  };
  
  export const leftmenuTheme = (langkey: string) => {
    const leftmenu = builtInTheme[langkey]?.leftmenu || [];
  
    return {
      one: [
        {
          id: '--inbiz-color-menu-left-bg',
          isShow: false,
          name: '背景',
          langkey: 'menuBg',
          color: leftmenu[0],
        },
        {
          id: '--inbiz-color-menu-left-bg-selected',
          isShow: false,
          name: '选中背景',
          langkey: 'menuSelectBg',
          color: leftmenu[1],
        },
        {
          id: '--inbiz-color-menu-left-bg-hover',
          isShow: false,
          name: 'hover背景',
          langkey: 'menuHoverBg',
          color: leftmenu[2],
        },
        {
          id: '--inbiz-color-menu-left-default',
          isShow: false,
          name: '默认字色',
          langkey: 'menuFontColor',
          color: leftmenu[3],
        },
        {
          id: '--inbiz-color-menu-left-selected',
          isShow: false,
          name: '选中字色',
          langkey: 'menuSelectFontColor',
          color: leftmenu[4],
        },
        {
          id: '--inbiz-font-size-menu-left',
          isShow: false,
          name: '字号',
          langkey: 'menuFontSize',
          size: platform == 'wap' ? 13 : 14,
          fontSize: platform == 'wap' ? '13px' : '14px',
        },
      ],
      child: [
        {
          id: '--inbiz-color-menu-left-child-bg',
          isShow: false,
          name: '背景',
          langkey: 'menuBg',
          color: leftmenu[0],
        },
        {
          id: '--inbiz-color-menu-left-bg-child-selected',
          isShow: false,
          name: '选中背景',
          langkey: 'menuSelectBg',
          color: leftmenu[1],
        },
        {
          id: '--inbiz-color-menu-left-bg-child-hover',
          isShow: false,
          name: 'hover背景',
          langkey: 'menuHoverBg',
          color: leftmenu[2],
        },
        {
          id: '--inbiz-color-menu-left-child-default',
          isShow: false,
          name: '默认字色',
          langkey: 'menuFontColor',
          color: leftmenu[3],
        },
        {
          id: '--inbiz-color-menu-left-child-selected',
          isShow: false,
          name: '选中字色',
          langkey: 'menuSelectFontColor',
          color: leftmenu[4],
        },
        {
          id: '--inbiz-font-size-menu-child-left',
          isShow: false,
          name: '字号',
          langkey: 'menuFontSize',
          size: platform == 'wap' ? 13 : 14,
          fontSize: platform == 'wap' ? '13px' : '14px',
        },
      ],
    };
  };
  
  export const presetColors = [
    '#ff3b30',
    '#ff9500',
    '#ffcc00',
    '#4cd964',
    '#5ac8fa',
    '#1989fa',
    '#4f2ed1',
    '#ffffff',
    '#dddddd',
    '#aaaaaa',
    '#999999',
    '#666666',
    '#333333',
    '#000000',
  ];
  